import { extend } from 'umi-request';

function myRequest(url: string, options: any) {
  const csrfToken = document.cookie.split('; ')?.pop()?.split('=')[1];
  console.log("🚀 ~ file: request.ts ~ line 5 ~ myRequest ~ csrfToken", document.cookie)
  return extend({
    headers: {
      "x-csrf-token": csrfToken,
      "Authorization": sessionStorage.getItem('Authorization'),
    },
  })(url, options);
}

export {
  myRequest as request,
};
